package p270jp.pxv.android.userProfile.flux;

import androidx.lifecycle.AbstractC0720j0;
import java.util.Objects;
import p189gn.AbstractC3446l;
import p216hn.Lambda;
import p241im.UserProfileService;
import p258jd.SingleFlatMap;
import p267jm.UserProfileAction;
import p270jp.pxv.android.response.PixivResponse;
import p320lm.UserProfileRepository;
import p325m0.MutabilityOwnership;
import p467rd.subscribers;
import p491sd.C6034a;
import p493sf.AbstractC6043c;
import p593wc.Single;
import p603wm.Unit;
import p665z6.C7463r;
import p671zc.CompositeDisposable;
import p671zc.Disposable;

/* compiled from: UserProfileActionCreator.kt */
/* renamed from: jp.pxv.android.userProfile.flux.UserProfileActionCreator */
/* loaded from: classes2.dex */
public final class UserProfileActionCreator extends AbstractC0720j0 {

    /* renamed from: c */
    public final UserProfileService f19445c;

    /* renamed from: d */
    public final AbstractC6043c f19446d;

    /* renamed from: e */
    public final CompositeDisposable f19447e = new CompositeDisposable();

    /* compiled from: UserProfileActionCreator.kt */
    /* renamed from: jp.pxv.android.userProfile.flux.UserProfileActionCreator$a */
    /* loaded from: classes2.dex */
    public static final class C4366a extends Lambda implements AbstractC3446l<Throwable, Unit> {
        public C4366a() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Throwable th) {
            Throwable th2 = th;
            MutabilityOwnership.m3745m(th2, "it");
            UserProfileActionCreator.this.f19446d.mo2437b(new UserProfileAction.C3973b(th2));
            return Unit.f29503a;
        }
    }

    /* compiled from: UserProfileActionCreator.kt */
    /* renamed from: jp.pxv.android.userProfile.flux.UserProfileActionCreator$b */
    /* loaded from: classes2.dex */
    public static final class C4367b extends Lambda implements AbstractC3446l<PixivResponse, Unit> {
        public C4367b() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(PixivResponse pixivResponse) {
            PixivResponse pixivResponse2 = pixivResponse;
            AbstractC6043c cVar = UserProfileActionCreator.this.f19446d;
            MutabilityOwnership.m3746l(pixivResponse2, "it");
            cVar.mo2437b(new UserProfileAction.C3972a(pixivResponse2));
            return Unit.f29503a;
        }
    }

    public UserProfileActionCreator(UserProfileService aVar, AbstractC6043c cVar) {
        MutabilityOwnership.m3745m(aVar, "userProfileService");
        MutabilityOwnership.m3745m(cVar, "dispatcher");
        this.f19445c = aVar;
        this.f19446d = cVar;
    }

    @Override // androidx.lifecycle.AbstractC0720j0
    /* renamed from: b */
    public void mo315b() {
        this.f19447e.m80f();
    }

    /* renamed from: d */
    public final void m4514d(long j) {
        UserProfileRepository aVar = this.f19445c.f17525a;
        Single<String> a = aVar.f22598a.mo1127a();
        C7463r rVar = new C7463r(aVar, j, 3);
        Objects.requireNonNull(a);
        Disposable e = subscribers.m2591e(new SingleFlatMap(a, rVar).m966j(C6034a.f26178c), new C4366a(), new C4367b());
        CompositeDisposable aVar2 = this.f19447e;
        MutabilityOwnership.m3744n(aVar2, "compositeDisposable");
        aVar2.mo82c(e);
    }
}
